package cn.duckerkj.util.safeutil;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;


public class Test {
	public static void main(String[] args) throws Exception {
		String param="00000000000000000000000000000000";
		param = Base64.getBase64(param);
		System.out.println(param);
		param=Sha1Util.getSha1(param);
		System.out.println(param);
		ConfigUtil.setPropertiesName("publickey.properties");
		ConfigUtil.init();
		RSAPublicKey pubKey = RSAUtils.getPublicKey(ConfigUtil.getValue("modulus"),ConfigUtil.getValue("public_exponent"));
		//加密后的数据
		String pubparam = RSAUtils.encryptByPublicKey(param, pubKey);
		
		
		System.out.println("#####"+pubparam+"#####");
		
		
		ConfigUtil.setPropertiesName("privatekey.properties");
		ConfigUtil.init();
		RSAPrivateKey priKey = RSAUtils.getPrivateKey(ConfigUtil.getValue("modulus"),ConfigUtil.getValue("private_exponent"));
		System.out.println("*****"+RSAUtils.decryptByPrivateKey(pubparam, priKey));;
		param="00000000000000000000000000000000";
		param = Base64.getBase64(param);
		param = param.hashCode()+"";
		System.out.println(param);
	}
}
